﻿@inherits Isha.Web.Mvc.IshaViewPage
@{
    string url = string.Empty;
    foreach (var item in IshaModel.Breadcrumbs)
    {
        url = url + "/" + item.Link;
    }

    string[] tabs = Request.Url.AbsolutePath.Split('/');        

}
@if (IshaContext.Current.Command != Isha.Extensions.Commands.Create)
{
    <div id="edit-bar">
        <h5 class="hiddenStructure">
            Views</h5>
        <ul class="contentViews" id="content-views">
            @if (IshaContext.Current.ContentItem.IsContainable == true || IshaContext.Current.ContentItem.IsHome)
            {
                <li id="contentview-folderContents" class="@(Request.Url.AbsolutePath == Url.Content(url + "/listcontents") || Request.Url.AbsolutePath == Url.Content("/listcontents") ? "selected" : "plain")">
                    <a href="@(IshaContext.Current.ContentItem.IsHome ? "/listcontents" : Url.Content(url + "/listcontents"))" >
                        Contents</a> </li>
            }
            <li id="contentview-view" class="@(Request.Url.Segments.Last() == "/" || Request.Url.Segments.Last() == IshaModel.ContentItem.Link ? "selected" : "plain")">
                <a href="@((url != "") ? Url.Content(url) : "")" >View</a> </li>
            <li id="contentview-edit" class="@(Request.Url.AbsolutePath == Url.Content(url + "/portal_factory/edit") ? "selected" : "plain")">
                <a href="@Url.Content(url + "/portal_factory/edit")" >Edit</a> </li>
        </ul>
        @if (IshaContext.Current.Command == Isha.Extensions.Commands.ListContents || IshaContext.Current.Command == Isha.Extensions.Commands.Detail)
        {
            <div class="contentActions">
            <ul id="contentActionMenus">
                <li>
                    <dl class="actionMenu deactivated" id="plone-contentmenu-workflow">
                        <dt class="actionMenuHeader label-state-published"><a href="#"
                            title="Change the state of this item"><span>State:</span> <span class="state-published">
                                Published</span> <span class="arrowDownAlternative">&#9660;</span> </a></dt>
                        <dd class="actionMenuContent">
                            <ul>
                                <li><a href="#"
                                    class="kssIgnore" id="workflow-transition-reject" title="Sending the item back will return the item to the original author instead of publishing it. You should preferably include a reason for why it was not published.">
                                    <span class="subMenuTitle">Send back</span> </a></li>
                                <li><a href="#"
                                    class="kssIgnore" id="workflow-transition-retract" title="If you submitted the item by mistake or want to perform additional edits, this will take it back.">
                                    <span class="subMenuTitle">Retract</span> </a></li>
                                <li class="actionSeparator"><a href="#"
                                    class="kssIgnore" id="advanced" title=""><span class="subMenuTitle">Advanced...</span>
                                </a></li>
                            </ul>
                        </dd>
                    </dl>
                </li>
                @if (IshaContext.Current.ContentItem.IsContainable == true || IshaContext.Current.ContentItem.IsHome)
                {
                    <li>
                        <dl class="actionMenu deactivated" id="plone-contentmenu-factories">
                            <dt class="actionMenuHeader label-"><a href="http://plone-demo.sixfeetup.com/folder_factories"
                                title="Add new items inside this item"><span>Add new…</span> <span class="arrowDownAlternative">
                                    &#9660;</span> </a></dt>
                            <dd class="actionMenuContent">
                                <ul>
                                    @foreach (var item in IshaContext.Current.ServiceContext.ContentTypeService.GetContentTypes())
                                    {
                                        <li><a class="contenttype-topic" href="@(IshaContext.Current.ContentItem.IsHome ? @Url.Content("/portal_factory/" + item.Title.ToLower() + "/create") : @Url.Content(url + "/portal_factory/" + item.Title.ToLower() + "/create"))">
                                            <span class="subMenuTitle">@item.Title</span></a></li>
                                    }
                                </ul>
                            </dd>
                        </dl>
                    </li>
                }
            </ul>
        </div>
        }
    </div>
}